/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package caintra.Sapra.ComponentsImplements;

/**
 *
 * @author Administrador
 */
public class DeleteSigns {
    public DeleteSigns(){
    }

    public String Delete_Signs_And_Numbers(String cadena){
        char caracter;
        int longitud=0;
        String aux="";
        try {
            cadena=cadena.trim();
            cadena=cadena.toLowerCase();
            cadena=cadena.replace('ñ', 'n');
            cadena=cadena.replace('á', 'a');
            cadena=cadena.replace('é', 'e');
            cadena=cadena.replace('í', 'i');
            cadena=cadena.replace('ñ','n');
            cadena=cadena.replace('ó','o');
            cadena=cadena.replace('ú', 'u');

            cadena=cadena.trim();
            cadena=cadena.toLowerCase();
            longitud=cadena.length();

            //(caracter>=30 && caracter <= 39)
            for(int i=0;i<longitud;i++){//verifica los caracteres de la cadena,para eliminar caracteres extraños
                caracter=cadena.charAt(i);//obtiene la secuencia de los caracteres
                if( (caracter >= 65 && caracter <= 90) || (caracter >= 97 && caracter <= 122) || caracter == ' '){
                    aux+=caracter;
                }
            }
            aux=aux.toUpperCase();
        } catch (Exception e) {
            return aux="";
        }
        return aux;
    }

}
